package com.xiaoling.robot.config;

import com.xiaoling.robot.bean.Lang;

import java.util.ArrayList;
import java.util.List;

public class TranslateConfig {
    public static List<Lang> langList;
    public static StringBuilder sb;
    public static boolean opened;
    public static boolean startTranslate;
    public static boolean setSourceText;
    public static int src = 1;
    public static int target = 2;
    public static String sourceText = "";

    static {
        init();
    }

    private static void init() {
        langList = new ArrayList<>();
        sb = new StringBuilder();
        langList.add(new Lang(Language.ZH, "zh"));
        langList.add(new Lang(Language.EN, "en"));
        langList.add(new Lang(Language.JA, "ja"));
        langList.add(new Lang(Language.KO, "ko"));
        int i = 0;
        sb.append("支持语种如下：\n");
        for(Lang lang : langList) {
            sb.append(" [").append(++i).append("] ");
            sb.append(lang.getText());
            sb.append("\n");
        }
        sb.append("请按“被翻译语言编号,目标语言编号”来回复。");
    }

    public static String getSrc() {
        return langList.get(src - 1).getAbbreviation();
    }

    public static String getTarget() {
        return langList.get(target - 1).getAbbreviation();
    }
}

